package xerr

const (
	OK            = 0
	SystemError   = 1
	DataBaseError = 2
	CacheError    = 3
	ParamError    = 4

	GenTokenError   = 11
	ParseTokenError = 12

	// 用户
	UserNameError     = 100001
	UserPassError     = 100002
	UserNotExistError = 100003
	UserCreateError   = 100004
	UserGetError      = 100005
	UserDelError      = 100006
	UserGetListError  = 100007
	UserFollowError   = 100008
	UserUnFollowError = 100009

	// 视频
	VideoNotExistError = 200001
	VideoCreateError   = 200002
	VideoGetError      = 200003
	VideoDelError      = 200004
	VideoGetListError  = 200005
	VideoLikeError     = 200006
	VideoUnlikeError   = 200007

	// 评论
	CommentNotExistError = 300001
	CommentCreateError   = 300002
	CommentGetError      = 300003
	CommentDelError      = 300004
	CommentGetListError  = 300005

	// 消息
	MessageNotExistError = 400001
	MessageCreateError   = 400002
	MessageGetError      = 400003
	MessageDelError      = 400004
	MessageGetListError  = 400005
	MessageAddListError  = 400006
	MessageDelListError  = 400007
)

var CodeMap = map[int]string{
	OK:            "成功",
	SystemError:   "系统错误",
	DataBaseError: "数据库错误",
	CacheError:    "缓存错误",
	ParamError:    "参数错误",

	GenTokenError:   "生成token失败",
	ParseTokenError: "解析token失败",

	UserNameError:     "用户名已存在",
	UserPassError:     "密码错误",
	UserNotExistError: "用户不存在",
	UserCreateError:   "用户新增失败",
	UserGetError:      "用户查询失败",
	UserDelError:      "用户删除失败",
	UserGetListError:  "用户批量查询失败",
	UserFollowError:   "关注失败",
	UserUnFollowError: "取关失败",

	VideoNotExistError: "视频不存在",
	VideoCreateError:   "视频创建失败",
	VideoGetError:      "视频查询失败",
	VideoDelError:      "视频删除失败",
	VideoGetListError:  "视频批量获取失败",
	VideoLikeError:     "视频点赞失败",
	VideoUnlikeError:   "视频取消点赞失败",

	CommentNotExistError: "评论不存在",
	CommentCreateError:   "评论创建失败",
	CommentGetError:      "评论查询失败",
	CommentDelError:      "评论删除失败",
	CommentGetListError:  "评论批量获取失败",

	MessageNotExistError: "消息不存在",
	MessageCreateError:   "消息创建失败",
	MessageGetError:      "消息查询失败",
	MessageDelError:      "消息删除失败",
	MessageGetListError:  "消息批量获取失败",
	MessageAddListError:  "消息批量新增失败",
	MessageDelListError:  "消息批量删除失败",
}
